#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;

int check(int qi[3][3], int a) {
    if (((qi[0][0] == a) & (qi[0][1] == a) & (qi[0][2] == a)) |
        ((qi[1][0] == a) & (qi[1][1] == a) & (qi[1][2] == a)) |
        ((qi[2][0] == a) & (qi[2][1] == a) & (qi[2][2] == a)) |
        ((qi[0][0] == a) & (qi[1][0] == a) & (qi[2][0] == a)) |
        ((qi[0][1] == a) & (qi[1][1] == a) & (qi[2][1] == a)) |
        ((qi[0][2] == a) & (qi[1][2] == a) & (qi[2][2] == a)) |
        ((qi[0][0] == a) & (qi[1][1] == a) & (qi[2][2] == a)) |
        ((qi[0][2] == a) & (qi[1][1] == a) & (qi[2][0] == a))) {
        return 1;
    }
    return 0;
}

string tictactoe(vector<vector<int> >& moves) {
    int qi[3][3] = {};

    int tag = 0;
    for (int i = 0; i < moves.size(); i++) {
        int row = moves[i][0];
        int col = moves[i][1];
        if (tag == 0) {
            qi[row][col] = 1;
        } else {
            qi[row][col] = 2;
        }
        tag = 1 - tag;
    }

    if (check(qi,1)){
        return "A";
    } else if(check(qi,2)){
        return "B";
    } else if(moves.size()<9){
        return "Pending";
    } else{
        return "Draw";
    }

}

int main() {
    vector<vector<int> > moves;

    vector<int> a(2, 0);

    moves.push_back(a);
    moves.push_back(a);
    moves.push_back(a);

    cout << tictactoe(moves) << endl;

    return 0;
}